function getUrlOption() {
  try {
    let str = decodeURI(window.location.hash.split('?')[1]).split('&')
    console.log('srt', str)
    let obj = {}
    str.forEach((e) => {
      let list = e.split('=')
      obj[list[0]] = list[1]
    })
    return obj
  } catch (error) {
    return {}
  }
}

//读取缓存
function get_cache(key) {
  try {
    return window.localStorage.getItem(key)
  } catch (error) {
    return null
  }
}

//设置缓存
function set_cache(key, value) {
  if (key === '') return false
  window.localStorage.setItem(key, value)
}

export { getUrlOption, get_cache, set_cache }
